#if !defined(__DOORBELL_CODEC_H__)
#define __DOORBELL_CODEC_H__

#include <freertos/ringbuf.h>
#include <driver/i2s_std.h>

#define I2S_PORT I2S_NUM_0

#define I2S_SAMPLE_RATE 16000
#define I2S_BITS_PER_SAMPLE 16
#define I2S_CHANNEL_NUM 1

#define I2S_MCK_PIN 3
#define I2S_BCK_PIN 2
#define I2S_WS_PIN 5
#define I2S_DO_PIN 6
#define I2S_DI_PIN 4

#define I2C_PORT I2C_NUM_0
#define I2C_SCL_PIN 1
#define I2C_SDA_PIN 0

#define PA_PIN 46

void doorbell_codec_init(RingbufHandle_t mic_buf, RingbufHandle_t speaker_buf);

void doorbell_codec_start(void);

void doorbell_codec_stop(void);

void doorbell_codec_play(uint8_t *data, size_t size);

void doorbell_codec_deinit(void);

#endif // __DOORBELL_CODEC_H__
